import type { PageParams, PageResult } from '@/types/global'
import type { bannerItem, categoryItem, GuessItem, HomeHotItem } from '@/types/home'
import { http } from '@/utils/http'

// 首页轮播图接口
export const getHomeBannerApi = (distributionSite = 1) => {
  return http<bannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

// 首页前台分类
export const getCategoryMutliApi = () => {
  return http<categoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
// 首页热门推荐
export const getHomeHotMutliApi = () => {
  return http<HomeHotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
// 首页猜你喜欢
export const getHomegGoodsGuessLikeApi = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
